package head.first.model.state.demo1;

/**
 * Created by yiyongyao on 2018/2/27.
 *
 * 完整的订单容器类
 */
public class OrderContext {

     OrderState state = null;

    //初试化订单状态, 已预订状态
    public OrderContext(){
        this.state=new OrderedState();
    }

    public void setState(OrderState state) {
        this.state = state;
    }

    public OrderState getState() {
        return state;
    }

    public void confirm()
    {
        state.confirm(this);
    }

    public void modify()
    {
        state.modify(this);
    }

    public void  pay()
    {
        state.pay(this);
    }

    public void dispalyState()
    {
        state.dispalyState(this);
    }
}
